import os
import pygame
from pygame.locals import *

def main():
  pygame.init()

  screen = pygame.display.set_mode((320, 320))
  font = pygame.font.Font(os.path.join("data", "fonts", "veramono.ttf"), 12)
  clock = pygame.time.Clock()

  running = True

  while running:
    # tick the clock and try to maintain 30 fps
    clock.tick(30)
  
    for event in pygame.event.get():
      if event.type == QUIT:
        running = False

    # get our FPS and put it into a surface so we can write it
    # to the screen
    fpsMessage = "FPS: %s" % (round(clock.get_fps(), 2))
    fpsMessageSurface = font.render(fpsMessage, 1, (255, 255, 255))

    screen.fill((120, 120, 120))
    screen.blit(fpsMessageSurface, (0, 0))
    pygame.display.flip()

  pygame.quit()

if __name__ == '__main__':
  main()
